{extend name="common@portalBase" /}
{block name="content"}
<style>
  .commitment {
    color: #1296db;
    cursor: pointer;
  }

  .iscommitment {
    color: #969797;
    font-size: small;
  }
</style>
<section class="content">
  <div class="row">
    <div class="col-xs-12">
      <div class="panel panel-default">
        <div class="panel-body">
          <h3 class="panel-title">
            {if $userInfo['exam_times']>0}
            <span>最近一次正式考试成绩{$userInfo['exam_score']}分</span>
            <span class="text-{$userInfo['exam_pass'] ? 'success' : 'danger'}">
              {$userInfo['exam_pass'] ? '通过' :'未通过'}</span>
            {else}
            <span>您尚未参加过正式考试</span>
            {/if}
            <span style="float: right">
          <span class="commitment">
            <img src="/static/images/commitment.png" width="24px" alt="" style="margin-right: 4px;">承诺书</span>
           {if($userInfo['commitment']==0)}
              <span class="iscommitment">（未签）</span>
              {/if}
            </span>
          </h3>

          </span>
        </div>
      </div>
      <div class="panel panel-primary">
        <div class="panel-heading">
          <h3 class="panel-title">模拟考试成绩</h3>
        </div>
        <div class="panel-body">
          <table id="table" class="table">
            <thead>
            <tr>
              <th>试卷得分</th>
              <th>排名</th>
              <th>时间</th>
              <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach $papers as $row}
            <tr>
              <td width="40%">{$row.score}</td>
              <td width="40%">本次考试您击败了{$row.score_sort}名同学。</td>
              <td width="40%">{$row.create_time}</td>
              <td width="15%"><a href="{:url('view',['id'=>$row.id])}" class="btn btn-default btn-sm">查看</a></td>
            </tr>
            {/foreach}
            </tbody>
          </table>
        </div>
        <div class="panel-footer">
        </div>
      </div>
    </div>
  </div>
  <!-- Modal -->
  <div class="modal fade" id="myModalCommitment" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span></button>
          <h4 class="modal-title" id="myModalLabel"></h4>
        </div>
        <div class="modal-body">
          <p style="font-size: 24px;font-weight: 600;text-align: center">承诺书</p>
          <div>
            {$commitment['content']}
          </div>
          <div class="row">
            <div class="col-xs-6 col-xs-offset-6"
                 style="text-align: left;font-weight: 600;margin-top: 20px;">
              {if($userInfo['commitment']>0)}
              <p>签订人：{$userInfo['realname']}</p>
              <p>日期：{:date('Y年m月d日',strtotime($userinfo['commitment_time']))}</p>
              {else}
              {/if}
            </div>
          </div>

        </div>
        <div class="modal-footer hide">


        </div>
      </div>
    </div>
  </div>
</section>
{/block}
{block name="page_script"}
<script>
  $(".commitment").on("mouseenter", function () {
    console.log('s');

    $('#myModalCommitment').modal();
  })

</script>
{/block}





